package com.symria.system.constants;

import java.util.HashMap;
import java.util.Map;

public class Status {

	public enum PayStatus {
		  NO_PAY ("no_pay","未支付"),
		  PAY ("pay","已支付");
		  public static final Map<String, PayStatus> statusMap = new HashMap<String, PayStatus>();
			static {
				PayStatus[] statu = PayStatus.class.getEnumConstants();
			    for(PayStatus s:statu ) {
			    	statusMap.put(s.status.toString(), s);
			}
		  }
		  public static PayStatus fromValue(String status) {
			    return statusMap.get(status);
		  }
		  public static String valueToName(String status){
			  AppStatus s = AppStatus.fromValue(status);
			  return null==s?"":s.toName();
		  }
		  @Override
		  public String toString() {
				return this.status.toString();
		  }
		 
		  
		  public String toName(){
			  return this.name;
		  }
		  private String status;
		  private String name;
		  PayStatus(String status,String name) {
		    this.status = status;
		    this.name = name;
		  }
	}
	
	public static enum Send {
        normal("normal","未通知","<span style='color:#666;'>未通知</span>"),
        success("success","通知成功","<span style='color:green;'>通知成功</span>"),
        fail("fail","通知失败","<span style='color:red;'>通知失败</span>"),
        sub("sub","核减","<span style='color:#red;'>核减</span>");
        private String status,name,html;
        public static final Map<String, Send> statusMap = new HashMap<String, Send>();
		static {
			Send[] statu = Send.class.getEnumConstants();
		    for(Send s:statu ) {
		    	statusMap.put(s.status.toString(), s);
		    }
	    }
        private Send(String status,String name,String html) {
            this.status = status;
            this.name=name;
            this.html=html;
        }
        public String toString(){
        	return this.status;
        }
        public String toName(){
        	return this.name;
        }
        public String toHtml(){
        	return this.html;
        }
        public static Send fromValue(String value) {
		    return statusMap.get(value);
	    }
        public static String valueToName(String value){
        	Send s = Send.fromValue(value);
  		  return null==s?value:s.toName();
  	    }
        public static String valueToHtmlName(String value){
        	Send s = Send.fromValue(value);
  		  return null==s?value:s.toHtml();
  	    }
	}
	
	public enum TouchEvent {
		  none ("none","无"),
		  download ("download","下载");
		  public static final Map<String, TouchEvent> statusMap = new HashMap<String, TouchEvent>();
			static {
				TouchEvent[] statu = TouchEvent.class.getEnumConstants();
			    for(TouchEvent s:statu ) {
			    	statusMap.put(s.status.toString(), s);
			}
		  }
		  public static TouchEvent fromValue(String status) {
			    return statusMap.get(status);
		  }
		  public static String valueToName(String status){
			  TouchEvent s = TouchEvent.fromValue(status);
			  return null==s?"":s.toName();
		  }
		  @Override
		  public String toString() {
				return this.status.toString();
		  }
		 
		  
		  public String toName(){
			  return this.name;
		  }
		  private String status;
		  private String name;
		  TouchEvent(String status,String name) {
		    this.status = status;
		    this.name = name;
		  }
	}
	
}
